<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
<select id="MySelect">
	<option value="aa">1</option>
	<option value="bb">2</option>
	<option value="cc">3</option>
</select>
<div class="a">
	<tr>
		<input type="checkbox">
	</tr>
	<td>
		<div class="b">
			<button id="mybut">测试</button>
		</div>
	</td>

</div>
<table>
	<tbody>
	<tr data-index="0" class="">
		<td data-field="0" id="test">
			<div class="layui-table-cell laytable-cell-4-0 laytable-cell-checkbox"><input type="checkbox"
																						  name="layTableCheckbox"
																						  lay-skin="primary">
				<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
			</div>
		</td>
		<td data-field="UUID">
			<div class="layui-table-cell laytable-cell-4-UUID">lsjflsjflsfjsl</div>
		</td>
		<td data-field="CnName">
			<div class="layui-table-cell laytable-cell-4-CnName">创建快选标签</div>
		</td>
		<td data-field="Module">
			<div class="layui-table-cell laytable-cell-4-Module">Console</div>
		</td>
		<td data-field="Controller">
			<div class="layui-table-cell laytable-cell-4-Controller">Access</div>
		</td>
		<td data-field="Action">
			<div class="layui-table-cell laytable-cell-4-Action">FlatCreat</div>
		</td>
		<td data-field="6" data-off="true">
			<div class="layui-table-cell laytable-cell-4-6">
				<Button id="bibi" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="WidgetInRoleBar">控件</Button>
			</div>
		</td>
	</tr>
	</tbody>
</table>

<script src="./js/jquery-3.2.1.min.js"></script>
<script>
	var AccessTotalData = JSON.parse('<{$FlatJSON}>'.replace(/&quot;/g, '"'));
	//处理数据，添加标记
	function AddSign(Data) {
		var Marks = function(n){
			var str = "";
			for(var i=0;i<n;i++){
				str = str + " |---- ";
			}
			return str;
		};
		var FlatsTotal = [], FlatsSum = 0;
		function AddLevel(Array,Level = 0){
			for(var Key in Array){
				Array[Key].Level = Level;
				Array[Key].CnName = Marks(Array[Key].Level)+Array[Key].CnName;
				FlatsTotal[FlatsSum] = Array[Key];
				FlatsSum = FlatsSum + 1;
				if(0 != Object.keys(Array[Key].Children).length) {
					AddLevel(Array[Key].Children, Level + 1);
				}
			}
			return FlatsTotal;
		}
		AddLevel(Data);
	}
	var TagsInFlatsData = AddSign(AccessTotalData.Tags);

	var FlatsJsonObject = AddSign(AccessTotalData.Flats);

	var tableIns = table.render({
		elem: '#IntroList'
		, height: 700
		, data: IntroJson.data //数据接口
		, cols: [[
			{type: 'checkbox'}
			, {field: 'StuName', title: '学生姓名'}
			, {field: 'ParName', title: '家长姓名'}
			, {field: 'ParPhone', title: '家长电话'}
			, {field: 'IntroName', title: '介绍人姓名'}
			, {field: 'IntroPhone', title: '介绍人电话'}
			, {field: 'ReceiveName', title: '接待人'}
			, {field: 'School', title: '校区'}
			, {field: 'SignUpDate', title: '报名日期'}
			, {field: 'VisitDate', title: '到访日期'}
			, {field: 'ReportDate', title: '报备日期'}

			, {fixed: 'right', title: "操作", toolbar: '#IntroBar'}
		]]
	});


	var tableIns = table.render({
		elem: '#IntroList'
		, height: 700
		, data: IntroJson.data //数据接口
		, cols: [
			[	{align: 'center', title: '填单日期', colspan: 3}
				,{align: 'center', title: '在校学员信息', colspan: 5}
				,{align: 'center', title: '被转介绍学员信息', colspan: 5}
				,{align: 'center', title: '填单人', colspan: 1}

			],
			[{type: 'checkbox'}
				, {field: 'StuName', title: '学员姓名'}
				, {field: 'ParName', title: '年级'}
				, {field: 'ParPhone', title: '学校'}
				, {field: 'ParPhone', title: '电话号码'}

				, {field: 'IntroName', title: '学员姓名'}
				, {field: 'ReceiveName', title: '年级'}
				, {field: 'School', title: '学校'}
				, {field: 'IntroPhone', title: '电话号码'}
				, {field: 'SignUpDate', title: '预计报名日期'}


				, {fixed: 'right', title: "操作", toolbar: '#IntroBar'}]
		]
	});

	//执行一个 table 实例
	table.render({
		elem: '#IntroList'
		, height: 700
		, data: [
			{
				username:"李小龙",
				amount:"100",
				username:"李小龙",
				province:"河南",
				city:"郑州",
				county:"巴拉巴拉",
			},
			{
				username:"李小龙",
				amount:"100",
				username:"李小龙",
				province:"河南",
				city:"郑州",
				county:"巴拉巴拉",
			}
		]
		, cols:  [[ //标题栏
			{field: 'username', title: '联系人', width: 80, rowspan: 2} //rowspan即纵向跨越的单元格数
			,{field: 'amount', title: '金额', width: 80, rowspan: 2}
			,{align: 'center', title: '地址', colspan: 3} //colspan即横跨的单元格数，这种情况下不用设置field和width
		], [
			{field: 'province', title: '省', width: 80}
			,{field: 'city', title: '市', width: 120}
			,{field: 'county', title: '详细', width: 300}
		]]
	});


	var tableIns = table.render({
		elem: '#IntroList'
		, height: 700
		, data: IntroJson.data //数据接口
		, cols: [
			[{align: 'center', title: '在校学员信息', colspan: 5}
				,{align: 'center', title: '被转介绍学员信息', colspan: 5}
				,{align: 'center', title: '填单人', colspan: 1}
				,{align: 'center', title: '操作', colspan: 1}
			],
			[{type: 'checkbox'}
				, {field: 'StuName', title: '学员姓名'}
				, {field: 'ParName', title: '年级'}
				, {field: 'ParPhone', title: '学校'}
				, {field: 'ParPhone', title: '电话号码'}

				, {field: 'IntroName', title: '学员姓名'}
				, {field: 'ReceiveName', title: '年级'}
				, {field: 'School', title: '学校'}
				, {field: 'IntroPhone', title: '电话号码'}
				, {field: 'SignUpDate', title: '预计报名日期'}

				, {field: 'VisitDate', title: '填单人'}

				, {fixed: 'right', title: "操作", toolbar: '#IntroBar'}]
		]
	});
</script>
</body>
</html>